ISO C90 forbids mixed declarations and code Warning [Kernel Module Makefile]
Posted
by djTeller
on Stack Overflow
See other posts from Stack Overflow
or by djTeller
Published on 2010-05-29T12:38:18Z
Indexed on
2010/05/29
12:42 UTC
Read the original article
Hit count: 436
Hi,
I'm trying to compile a linux kernel module using a Makefile which looks like so:
obj-m += main.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
and i'm getting the following warning: main.c:54: warning: ISO C90 forbids mixed declarations and code
I need to switch to C99.
After reading i noticed i need to add a flag -std=c99, not sure where it suppose to be added.
How do I change the Makefile so it will compile through C99 ?
Thanks!
© Stack Overflow or respective owner